import request from "@/utils/request";

export function pageRoles(pageNum, pageSize, roleName) {
    return request({
        url: `/role/page?pageNum=${pageNum}&pageSize=${pageSize}&roleName=${roleName}`,
        method: 'get',
    })
}

export function saveRole(role) {
    return request({
        url: `/role`,
        method: 'post',
        data: role
    })
}

export function modifyRoles(role) {
    return request({
        url: `/role`,
        method: 'put',
        data: role
    })
}

export function removeRoles(id) {
    return request({
        url: `/role/${id}`,
        method: 'delete',
    })
}

export function assign(roleMenu) {
    return request({
        url: `/role/assign`,
        method: 'post',
        data: roleMenu
    })
}

export function userNotHasRoles(id) {
    return request({
        url: `/role/not/${id}`,
        method: 'get',
    })
}

export function userHasRoles(id) {
    return request({
        url: `/role/has/${id}`,
        method: 'get',
    })
}
